// gui/GuiSprite.cpp
#include "GuiSprite.h"

#include <renderer/Interfaces.hpp>

TypeId GUI::GuiSprite::s_TypeId = "GuiSprite";

using namespace GUI;

void GuiSprite::SetupGuiSprite(const Math::vec3 & vPos,
								GFX::Texture * pTexture,
								CORE::Colour & colSprite,
								float32_t fWidth,
								float32_t fHeight)
{
	m_Sprite.SetupVisualSprite(vPos, pTexture, colSprite, fWidth, fHeight);
	SetVisual(&m_Sprite);
	GetFrame().AttachFrame( &m_Sprite.GetFrame() );
}

void GuiSprite::SetupAtlasGuiSprite(const Math::vec3 & vPos,
								GFX::Texture * pTexture,
								CORE::Colour & colSprite,
								float32_t fWidth,
								float32_t fHeight,
								const GFX::Visual::AtlasInfo &atlasInfo)
{
	m_Sprite.SetupAtlasVisualSprite(vPos, pTexture, colSprite, fWidth, fHeight, atlasInfo);
	SetVisual(&m_Sprite);
	GetFrame().AttachFrame( &m_Sprite.GetFrame() );
}

void GuiSprite::Render( IRenderingEngine * pRenderer )
{
	GuiComponent::Render( pRenderer );
}